package pt.nmfa.peste.entity;

// Generated Mar 5, 2011 1:52:20 PM by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * StatusActions generated by hbm2java
 */
@Entity
@Table(name = "statusActions", catalog = "HomeDB")
public class StatusActions implements java.io.Serializable {

	private Integer statusActionId;
	private Device device;
	private String statusAction;
	private Set<StatusActionsScript> statusActionsScripts = new HashSet<StatusActionsScript>(
			0);

	public StatusActions() {
	}

	public StatusActions(Device device, String statusAction) {
		this.device = device;
		this.statusAction = statusAction;
	}

	public StatusActions(Device device, String statusAction,
			Set<StatusActionsScript> statusActionsScripts) {
		this.device = device;
		this.statusAction = statusAction;
		this.statusActionsScripts = statusActionsScripts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "statusActionId", unique = true, nullable = false)
	public Integer getStatusActionId() {
		return this.statusActionId;
	}

	public void setStatusActionId(Integer statusActionId) {
		this.statusActionId = statusActionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deviceId", nullable = false)
	@NotNull
	public Device getDevice() {
		return this.device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	@Column(name = "statusAction", nullable = false, length = 32)
	@NotNull
	@Length(max = 32)
	public String getStatusAction() {
		return this.statusAction;
	}

	public void setStatusAction(String statusAction) {
		this.statusAction = statusAction;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "statusActions")
	public Set<StatusActionsScript> getStatusActionsScripts() {
		return this.statusActionsScripts;
	}

	public void setStatusActionsScripts(
			Set<StatusActionsScript> statusActionsScripts) {
		this.statusActionsScripts = statusActionsScripts;
	}

}
